import Vue from 'vue'
import VueRouter from 'vue-router'
import store from '../store/index'
import login from '../views/login/login.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/login',
    name: 'login',
    component: () => import( /* webpackChunkName: "group-foo" */ '../views/login/login.vue')
  },
  {
    path: '/index',
    component: () => import('../views/index/index.vue'),
    children: [{
        path: '/index/home',
        component: () => import('../views/home/index.vue')
      },
      {
        path: '/index/experience/:type',
        component: () => import('../views/experience/index.vue')
      },
      {
        path: '/index/analysis',
        component: () => import('../views/analysis/index.vue')
      },
      {
        path: '/index/core',
        component: () => import('../views/core/index.vue')
      },
    ]
  },
  {
    path: '/details',
    name: 'details',
    component: () => import('../views/details/index.vue')
  },
  {
    path: '/snapUp',
    component: () => import('../views/snapUp/index.vue')
  },
  {
    path: '/commodity',
    component: () => import('../views/commodity/index.vue')
  },
  {
    path: '/myCom',
    component: () => import('../views/myCom/index.vue')
  },
  {
    path: '/upper',
    component: () => import('../views/upper/index.vue')
  },
  {
    path: '/wallet',
    component: () => import('../views/wallet/index.vue')
  },
  {
    path: '/binding',
    component: () => import('../views/binding/index.vue')
  },
  {
    path: '/team',
    component: () => import('../views/team/index.vue')
  },
  {
    path: '/invitation',
    component: () => import('../views/invitation/index.vue')
  },
  {
    path: '/addCard',
    name: 'addCard',
    component: () => import('../views/addCard/index.vue')
  },
  {
    path: '/goods',
    component: () => import('../views/goods/index.vue')
  },
  {
    path: '/total',
    component: () => import('../views/total/index.vue')
  },
  {
    path: '/purchase/:id',
    component: () => import('../views/purchase/index.vue')
  },
  {
    path: '/agreement',
    component: () => import('../views/agreement/index.vue')
  },
  {
    path: '/address',
    component: () => import('../views/address/index.vue')
  },
  {
    path: '/addressEdit',
    component: () => import('../views/address/view/addressEdit.vue')
  },
  {
    path: '/shopowner',
    component: () => import('../views/shopowner/index.vue')
  },
  {
    path: '/',
    redirect: '/index/home'
  }
]

const router = new VueRouter({
  routes
})

export default router